package com.niiwoo.civet.account.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 账户金额类型枚举
 * @author liaojunjun
 *
 */
@AllArgsConstructor
@Getter
public enum AccountAmountTypeEnum {

	INVEST_INCOME(101,"投资收益"),
	RESEARCH_INCOME(102,"尽调收益"),
	GUARANTEE_INCOME(103,"担保收益"),
	PLATFORM_GIVEN(104,"平台奖励"),
	INVEST_GIVEN(105,"投资奖励"), 
	PLATFORM_PROVIDE(106,"平台发放"),
	USER_RED_PACKET(107,"用户红包"),


	INVEST_FEE(201,"投资费用"),
	GUARANTEE_INCOME_FEE(202,"担保收益支出费用-担保人身份担保收益时支出手续费"),
	WITHDRAW_FEE(203,"提现手续费"),
	/**
	 * (借款的所有支出费用：担保费+预仲裁+平台服务费+平台管理费+利息+罚息)
	 */
	//BORROW_FEE(204,"借款费用"),
	BORROW_GUARANTEE_SERVICE_FEE(205,"借款担保服务费"),
	BORROW_PLATFORM_SERVICE_FEE(207,"借款平台服务费"),
	BORROW_PLATFORM_MANAGER_FEE(208,"借款平台管理费"),
	BORROW_INTEREST(209,"借款利息"),
	BORROW_PENALTY_FEE(210,"借款罚息"),
	BORROW_GUARANTEE_FEE(211,"借款担保费"),
	COLLECTION_SERVICE_FEE(212,"催收服务费"),
	INVESTIGATE_FEE(213,"尽调费"),
	BORROW_CONSULTING_FEE(214,"借款咨询服务费"),
	BORROW_BEFORE_SEEK_ADVICE_SERVICE_FEE(215,"借款前置咨询服务费"),

	CREDITOR_SALE_FEE(216,"债权出让手续费"),


	RECHARGE_TOTAL(301,"累计充值金额"),
	WITHDRAW_TOTAL(302,"累计提现金额"),
	INVEST_TOTAL(303,"累计投资金额"),
	BORROW_TOTAL(304,"累计借款金额"),
	REPAYMENT_TOTAL(305,"累计还款金额"),

	/**
	 * 财富总额(可用余额[投资账户余额+借款账户余额(直接查询account表可用余额)]+待收本息+担保保证金+垫付金额+其他金额)
	 */

	/**
	 * 在途金额(待收本息+担保保证金+垫付金额+其它金额)
	 * 待收本息(待收本金+待收利息+待收罚息)
	 */
	DUE_IN_CORPUS(401,"待收本金"),
	DUE_IN_INTEREST(402,"待收利息"),
	DUE_IN_PENALTY_FEE(403,"待收罚息"),
	GUARANTEE_CASH_DEPOSIT(404,"担保保证金"),
	ADVANCE(405,"垫付金额"),


	/**
	 * 其它金额 (投资冻结+担保中未成标金额+还款冻结+提现冻结)
	 */
	INVEST_FREEZE(501,"投资冻结"),
	GUARANTEE_FREEZE(502,"担保冻结"),
	REPAYMENT_FREEZE(503,"还款冻结"),
	WITHDRAW_FREEZE(504,"提现冻结"),

	/**
	 * 老系统中才产生的数据
	 */
	IN_CUSTODY_MARGIN(901,"在押保证金"),
	CUMULATE_TRAVEL_FEE(902,"累计尽调车马费");
	

    private Integer code;
    private String desc;

    public static AccountAmountTypeEnum enumOf(Integer code) {
        for (AccountAmountTypeEnum accountAmountType : values()) {
            if (accountAmountType.code.equals(code)) {
                return accountAmountType;
            }
        }
        throw new NoSuchEnumValueException("AccountAmountTypeEnum:" + code);
    }
}
